package com.easyShop.controller;


import com.easyShop.common.Result;
import com.easyShop.entity.OrderSetting;
import com.easyShop.service.OrderSettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 订单设置表 前端控制器
 * </p>
 *
 * @author wms
 * @since 2024-12-02
 */
@RestController
@RequestMapping("/ordersetting")
public class OrderSettingController {
    @Autowired
    private OrderSettingService orderSettingService;

    //更新
    @PostMapping("/save")
    public Result save(@RequestBody OrderSetting orderSetting) {
        return orderSettingService.save(orderSetting)?Result.suc():Result.fail();
    }
    //更新
    @PostMapping("/update")
    public Result update(@RequestBody OrderSetting orderSetting){
        return orderSettingService.updateById(orderSetting)?Result.suc():Result.fail();
    }
    //显示or查看
    @GetMapping("/list")
    public Result list() {
        List list = orderSettingService.list();
        return Result.suc(list);
    }
}
